import request from "../utils/request";


// 微信登录
export const wxLogin = (params) => {
  return request({
    url: "/weixin/api/wxuser/login",
    method: "post",
    params
  });
}
// 获取用户信息
export const getWxUserInfo = (params) => {
  return request({
    url: "/weixin/api/wxuser",
    method: "get",
    params
  });
}
// 修改用户信息
// export const postWxUserInfo = (params) => {
//   return request({
//     url: "/weixin/api/wxuser",
//     method: "post",
//     params
//   });
// }






// 分类列表
export const getCategoryList = (params) => {
  return request({
    url: "/weixin/api/wxproduct/categorylist",
    method: "get",
    params
  });
}

// 产品列表
export const getProductList = (params) => {
  return request({
    url: "/weixin/api/wxproduct/list",
    method: "get",
    params
  });
}

// 产品详情
export const getProductInfo = (id) => {
  return request({
    url: "/weixin/api/wxproduct/"+id,
    method: "get"
  });
}

// 售前咨询
export const addPreSaleZixun = (params) => {
  return request({
    url: "/weixin/api/wxpresale",
    method: "post",
    params
  });
}


// 经销商列表
export const getDealerList = (params) => {
  return request({
    url: "/weixin/api/wxdealer/list",
    method: "get",
    params
  });
}
// 售后菜单
export const getMenuList = (params) => {
  return request({
    url: "/weixin/api/wxmenu/list",
    method: "get",
    params
  });
}

// 提交增值服务申请
export const addService = (params) => {
  return request({
    url: "/weixin/api/wxvas/custom",
    method: "post",
    params
  });
}
//增值服务列表
export const getServiceList = (params) => {
  return request({
    url: "/weixin/api/wxvas/list",
    method: "get",
    params
  });
}


export const getAttachmentList = (params) => {
  return request({
    url: "/weixin/api/wxattachment/list",
    method: "get",
    params
  });
}

export const getAttachmentTypeList = (params) => {
  return request({
    url: "/weixin/api/wxattachment/typeList",
    method: "get",
    params
  });
}
export const getAreaList = (params) => {
  return request({
    url: "/weixin/api/wxarea/list",
    method: "get",
    params
  });
}
export const getConfig = (id) => {
  return request({
    url: `/weixin/api/wxconfig/${id}`,
    method: "get",
  });
}


export const getDownLoad = (id) => {
  return request({
    url:`https://prosystem.panasonic.cn/vadmin/api/product/getByProductId?productId=${id}`,
    method: "get",
  })
}